package com.itheima.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

/**
 * AOP 通知顺序
 */
@Slf4j
@Component
//@Aspect //切面类
public class AspectDemo5 {

    //将来只要目标类方法上有@Log注解的，都增强
    @Before("@annotation(com.itheima.anno.Log)")
    public void before(JoinPoint joinPoint) {
        String name = joinPoint.getSignature().getName();
        log.info("name {}", name);
    }


}
